import os


def fc_read_file(filename):
    """
    读取文件内容
    :param filename: 文件名
    :return: 文件内容
    """
    try:
        with open(filename, 'r') as file:
            content = file.read()
            return content
    except FileNotFoundError:
        return None
    except Exception as e:
        return None

def fc_write_file(filename, content):
    """
    写入文件内容
    :param filename: 文件名
    :param content: 文件内容
    :return: 写入结果
    """
    try:
        # 获取文件所在的目录
        directory = os.path.dirname(filename)
        # 如果目录不存在，则创建目录
        if directory and not os.path.exists(directory):
            os.makedirs(directory)
        with open(filename, 'w', encoding='utf-8') as file:
            file.write(content)
            return True
    except Exception as e:
        return False